So recently I stumbled upon Crafting Interpreters book and it made me excited to try building language interpreters of my own. I’ll be documenting the whole journey in the upcoming blogs. This is part 00.
Notes from Crafting interpreter
a. constant folding languages like Lua and CPython spend most of their time optimizing runtime
assembly like instructions
Generating bytecode (Virtual machine code) Runtime ( fully compiled language, code implementing runtime gets inserted directly into executable)
No code parsing, analysis and code gen; output code in the parser without using IRs
Begin executing code right after parsing into AST
source to source compiler, consider you made a language -> compile to C -> then C compilation pipeline begins
executing code by compiling to machine code
Generating bytecode or machine code, you are compiling ( doesn’t execute it ) when we say interpreter, takes source code and executes immediately ( runs from source )
Thanks Robert for the amazing book, can’t wait to read more about interpreters on Crafting Interpreters